export default (listeners = {}) => {
  return {
    rules: {
      name: [
        { required: true, message: '客户姓名不能为空', trigger: 'blur' },
      ],
      phone: [
        {
          pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,
          message: '请输入正确的手机号码',
          trigger: 'blur',
        },
      ],
      email: [
        {
          type: 'email',
          message: '请输入正确的邮箱地址',
          trigger: ['blur', 'change'],
        },
      ],
    },
    formItems: [
      {
        field: 'name',
        type: 'input',
        label: '名称',
        config: {
          maxlength: 30,
        },
      },
      {
        label: '电话',
        field: 'phone',
        type: 'input',
      },
      {
        field: 'email',
        type: 'input',
        label: '邮箱',
        config: {
          controlsPosition: 'right',
          min: 0,
        },
      },
      {
        field: 'sex',
        type: 'select',
        options: [],
        label: '性别',
        isGroup: true,
        config: {
          clearable: false,
        },
        optionConfig: {
          border: true,
        },
      },
      {
        label: '单位',
        field: 'unit',
        type: 'input',
      },
      {
        label: '行业',
        field: 'industryId',
        type: 'treeSelect',
        options: ref([]),
        config: {
          props: { label: 'label', value: 'id', children: 'children' },
        },
      },
      {
        label: '销售',
        field: 'marketerName',
        type: 'custom',
      },
      {
        field: 'status',
        type: 'radio',
        label: '状态',
        isGroup: true,
        options: [],
        config: {
          clearable: false,
        },
        optionConfig: {
          border: true,
        },
      },
      {
        field: 'remark',
        type: 'textarea',
        label: '备注',
        config: {
          autosize: { minRows: 5, maxRows: 5 },
        },
        layout: {
          xl: 24,
          gl: 24,
          md: 24,
          sm: 24,
          xs: 24,
        },
      },
    ],
    colLayout: {
      xl: 12,
      gl: 12,
      md: 12,
      sm: 12,
      xs: 24,
    },
    itemStyle: {
      padding: '0px 8px 0px 8px',
    },
    elFormConfig: {
      labelWidth: '80px',
    },
    hideItems: ref([]),
  }
}
